/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: DemType.h
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: Dem
*
*******************************************************************************/

#ifndef DEMTYPE_H
#define DEMTYPE_H

/** HEADER FILES **/
#include "PlatformCfg.h" 


/** MACRO DEFINITION **/


/** TYPEDEF DEFINITION **/
typedef uint8 Dem_ConfigType;


#define DCM_PENDING (Std_ReturnType)0x04u
#define DEM_CLEAR_BUSY (Std_ReturnType)0x05u
#define DEM_CLEAR_MEMORY_ERROR (Std_ReturnType)0x06u
#define DEM_CLEAR_FAILED (Std_ReturnType)0x07u
#define DEM_WRONG_DTC (Std_ReturnType)0x08u
#define DEM_WRONG_DTCORIGIN (Std_ReturnType)0x09u
#define DEM_BUSY (Std_ReturnType)0x16u

typedef uint16 Dem_EventIdType;

typedef uint8 Dem_EventStatusType;
#define DEM_EVENT_STATUS_PASSED ((Dem_EventStatusType)(0x00u))
#define DEM_EVENT_STATUS_FAILED ((Dem_EventStatusType)(0x01u))
#define DEM_EVENT_STATUS_PREPASSED ((Dem_EventStatusType)(0x02u))
#define DEM_EVENT_STATUS_PREFAILED ((Dem_EventStatusType)(0x03u))
#define DEM_EVENT_STATUS_FDC_THRESHOLD_REACHED ((Dem_EventStatusType)(0x04u))

typedef uint32 Dem_MonitorDataType; /* This type is used to pass monitoring data to the Dem */

typedef uint8 Dem_MonitorStatusType;
#define DEM_MONITOR_STATUS_TF ((Dem_MonitorStatusType)(0x01u))
#define DEM_MONITOR_STATUS_TNCTOC ((Dem_MonitorStatusType)(0x02))

typedef uint8 Dem_DTCFormatType; /* This type is used to select the format of the DTC value */  
#define DEM_DTC_FORMAT_OBD ((Dem_DTCFormatType)(0u))
#define EM_DTC_FORMAT_UDS ((Dem_DTCFormatType)(1u))
#define DEM_DTC_FORMAT_J1939 ((Dem_DTCFormatType)(2u))
#define DEM_DTC_FORMAT_OBD_3BYTE ((Dem_DTCFormatType)(3u))

typedef uint16 Dem_DTCOriginType; /* This enum is used to define the location of the events */
#define DEM_DTC_ORIGIN_PRIMARY_MEMORY ((Dem_DTCOriginType)(0x0001u))
#define DEM_DTC_ORIGIN_PERMANENT_MEMORY ((Dem_DTCOriginType)(0x0003u))
#define DEM_DTC_ORIGIN_RELEVANT_MEMORY ((Dem_DTCOriginType)(0x0004u))

typedef uint8 Dem_DTCSeverityType;
#define DEM_SEVERITY_NO_SEVERITY ((Dem_DTCSeverityType)(0x00u))
#define DEM_SEVERITY_WWHOBD_CLASS_NO_CLASS ((Dem_DTCSeverityType)(0x01u))
#define DEM_SEVERITY_WWHOBD_CLASS_A ((Dem_DTCSeverityType)(0x02u))
#define DEM_SEVERITY_WWHOBD_CLASS_B1 ((Dem_DTCSeverityType)(0x04u))
#define DEM_SEVERITY_WWHOBD_CLASS_B2 ((Dem_DTCSeverityType)(0x08u))
#define DEM_SEVERITY_WWHOBD_CLASS_C ((Dem_DTCSeverityType)(0x10u))
#define DEM_SEVERITY_MAINTENANCE_ONLY ((Dem_DTCSeverityType)(0x20u))
#define DEM_SEVERITY_CHECK_AT_NEXT_HALT ((Dem_DTCSeverityType)(0x40u))
#define DEM_SEVERITY_CHECK_IMMEDIATELY ((Dem_DTCSeverityType)(0x80u))

typedef uint8 Dem_UdsStatusByteType;
#define DEM_UDS_STATUS_TF ((Dem_UdsStatusByteType)(0x01u))
#define DEM_UDS_STATUS_TFTOC ((Dem_UdsStatusByteType)(0x02u))
#define DEM_UDS_STATUS_PDTC ((Dem_UdsStatusByteType)(0x04u))
#define DEM_UDS_STATUS_CDTC ((Dem_UdsStatusByteType)(0x08u))
#define DEM_UDS_STATUS_TNCSLC ((Dem_UdsStatusByteType)(0x10u))
#define DEM_UDS_STATUS_TFSLC ((Dem_UdsStatusByteType)(0x20u))
#define DEM_UDS_STATUS_TNCTOC ((Dem_UdsStatusByteType)(0x40u))
#define DEM_UDS_STATUS_WIR ((Dem_UdsStatusByteType)(0x80u))


#endif

